package cn.wl.hrm.feign.client;

import cn.wl.hrm.doc.CourseDoc;
import cn.wl.hrm.feign.fallback.ESFeignClientFallbackFactory;
import cn.wl.hrm.query.CourseQuery;
import cn.wl.hrm.util.AjaxResult;
import cn.wl.hrm.util.PageList;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "es-server",fallbackFactory = ESFeignClientFallbackFactory.class )
public interface ESFeignClient {

    @RequestMapping(value = "/es/onLineCourse",method = RequestMethod.POST)
    public AjaxResult onLineCourse(@RequestBody CourseDoc doc);

    @RequestMapping(value = "/es/offLineCourse",method = RequestMethod.POST)
    //对象前面才打@RequestBody，普通类型前面用@RequestParam
    public AjaxResult offLineCourse(@RequestParam("id") Long id);

    @RequestMapping(value = "/es/searchCourse", method = RequestMethod.POST)
    public PageList<CourseDoc> searchCourse(@RequestBody CourseQuery courseQuery);
}
